<template>
  <div>
    <div style="padding: 5px 10px">
      <h3>课题信息:</h3>
      <table class="bs-table">
        <tr class="bs-table_row">
          <th class="bs-table_th">课题名称</th>
          <th class="bs-table_th">课题责任单位</th>
          <th class="bs-table_th">上传用户</th>
          <th class="bs-table_th">课题报告下载</th>
        </tr>
        <tr class="bs-table_row" v-for="(report,index) in detaildata.subjectDeptFileList" :key="index">
          <th class="bs-table_td"  style="width: 460px;">{{report.subjectTitle}}</th>
          <th class="bs-table_td">{{report.deptName}}</th>
          <th class="bs-table_td">{{report.uploadNickname}}</th>
          <th class="bs-table_td">
            <preview :attachementId="report.fileId" v-if="report.fileId"></preview>
            <span v-if="report.fileId == null && report.fileFullName != null">{{report.fileFullName}}</span>
          </th>
        </tr>
        <tr class="bs-table_row" v-if="!detaildata.subjectDeptFileList || detaildata.subjectDeptFileList.length == 0">
          <th class="bs-table_td"  colspan="4">
            暂无数据
          </th>
        </tr>
      </table>
    </div>
    <div style="padding: 5px 10px">
      <h3>课题征集信息:</h3>
      <table class="bs-table">
        <tr class="bs-table_row">
          <th class="bs-table_th" style="width: 500px;">课题征集主题</th>
          <th class="bs-table_th" style="width: 200px;">发起征集部门</th>
          <th class="bs-table_th">反馈截止时间</th>
        </tr>
        <tr class="bs-table_row" v-for="(opinion,index) in detaildata.opinionDetailList" :key="index">
          <th class="bs-table_td">{{opinion.title}}</th>
          <th class="bs-table_td">{{opinion.deptName}}</th>
          <th class="bs-table_td">{{opinion.endDate}}</th>
        </tr>
        <tr class="bs-table_row" v-if="!detaildata.opinionDetailList || detaildata.opinionDetailList.length == 0">
          <th class="bs-table_td"  colspan="4">
            暂无数据
          </th>
        </tr>
      </table>
    </div>
    <div style="padding: 5px 10px">
      <h3>课题计划信息:</h3>
      <table class="bs-table">
        <tr class="bs-table_row">
          <th class="bs-table_th"  style="width: 500px;">课题计划名称</th>
          <th class="bs-table_th" style="width: 200px;">编制时间</th>
          <th class="bs-table_th">编制用户</th>
        </tr>
        <tr class="bs-table_row"  v-for="(subjectPlanDetail,index) in detaildata.subjectPlanDetailList" :key="index">
          <th class="bs-table_td">{{subjectPlanDetail.title}}</th>
          <th class="bs-table_td">{{subjectPlanDetail.createTime}}</th>
          <th class="bs-table_td">{{subjectPlanDetail.createNickname}}</th>
        </tr>
        <tr class="bs-table_row" v-if="!detaildata.subjectPlanDetailList || detaildata.subjectPlanDetailList.length == 0">
          <th class="bs-table_td"  colspan="4">
            暂无数据
          </th>
        </tr>
      </table>
    </div>
  </div>
</template>

<script>
  import {getSubjectDetail} from "@/api/achievement";

  export default {
    name: "subjectList",
    props: {
      id: Number
    },
    created() {
      this.getSubjectDetailData();
    },
    computed: {},
    data() {
      return {
        detaildata:{}
      }
    },
    methods: {
      getSubjectDetailData(){
        getSubjectDetail(this.id).then(response => {
          if (response.data.code == 0) {
            this.detaildata  = response.data.data;
          }
        });
      }
    }
  }
</script>

<style ang="scss" scoped>

</style>
